//
//  CQTool.swift
//  weibo
//
//  Created by chengqiang on 16/7/21.
//  Copyright © 2016年 chengqiangBiaodashi. All rights reserved.
//

import UIKit
import AFNetworking
class CQTool: AFHTTPSessionManager {
    
    static let sharedNetworking:CQTool = CQTool(baseURL: NSURL(string: "https://api.weibo.com/"))
//自己来实现构造函数
    override init(baseURL url: NSURL?, sessionConfiguration configuration: NSURLSessionConfiguration?) {
        super.init(baseURL: url, sessionConfiguration: configuration)
        
        //添加反序列化支持的类型
        self.responseSerializer.acceptableContentTypes?.insert("text/plain")
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
